package com.CI.DeleteAccount.Commands
{
	import com.CI.DeleteAccount.Business.DeleteDelegate;
	import com.CI.DeleteAccount.Control.DelEternalEvents;
	import com.CI.DeleteAccount.Control.DelTemporaryEvents;
	import com.adobe.cairngorm.business.Responder;
	import com.adobe.cairngorm.commands.Command;
	import com.adobe.cairngorm.control.CairngormEvent;
	
	public class DeleteCommands implements Command,Responder
	{
		public function DeleteCommands()
		{
		}
		
		public function execute(event : CairngormEvent) : void
		{
			var str : String = event.type;
			
			if(str == 'DeleteTemporary')
			{
				var delTemporaryEvent : DelTemporaryEvents = DelTemporaryEvents(event);
				getDelegate.sendObject(delTemporaryEvent.accountTemporary);
			} 
			else
			{
				var delEtenalEvent : DelEternalEvents = DelEternalEvents(event);
				getDelegate.sendObject(delEtenalEvent.accountEternal);
			}
		}
		public function onFault(event : *=null) : void
		{
			
		}
		
		public function onResult(event : *=null) : void
		{
		}
		
		protected function get getDelegate(): DeleteDelegate
		{
			return new DeleteDelegate(this);
		}
	}
}